package bos.web.action;

import java.io.IOException;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import cn.itcast.crm.domain.Customer;

import bos.domain.Noticebill;
import bos.domain.User;
import bos.utils.BOSContext;
import bos.web.action.base.BaseAction;
@Controller
@Scope("prototype")
public class NoticebillAction extends BaseAction<Noticebill> {
	/**
	 * 
	 * @return
	 * @throws IOException
	 */
public String findCustomeByTelephone() throws IOException{
	Customer customer = customerService.findCustomerByPhonenumber(model.getTelephone());
	String[] excludes=new String[]{};
	this.writeObject2Json(customer, excludes);
	return NONE;
}
/***
 * 
 * @return
 */
public String add(){
	User user=BOSContext.getLoginUser();
	model.setUser(user);
	noticebillService.save(model);
	return "addUI";
}
}
